Multiple channel mode decisions and encoding

ABSTRACT

To select the encoding mode of an audio signal in a multi-channel system, a level of energy of the audio signal associated with each channel is determined, which in turn is used to compute a first value. Next, a second value based on a degree of correlation of the signals of each channel is determined. If the first value is smaller than the second value, the audio signal is encoded using a first encoding mode. Next, a third value defined by the energy levels and a fourth value defined by the correlation are computed. If the first value is greater than the second value, and the third value is smaller than the fourth value, the audio signal is encoded using a second encoding mode. Otherwise the audio signal is encoded using a third encoding mode.

CROSS-REFERENCES TO RELATED APPLICATIONS

[0001] Not Applicable

STATEMENT AS TO RIGHTS TO INVENTIONS MADE UNDER FEDERALLY SPONSORED RESEARCH OR DEVELOPMENT

[0002] Not Applicable

REFERENCE TO A “SEQUENCE LISTING,” A TABLE, OR A COMPUTER PROGRAM LISTING APPENDIX SUBMITTED ON A COMPACT DISK

[0003] Not Applicable

BACKGROUND OF THE INVENTION

[0004] The present invention relates to encoding of audio frames, and more particularly for encoding audio frames in multi-channel audio systems.

[0005] Many of the existing audio or video encoders are adapted for single channel systems. To encode audio frames associated with more than one channel, typically the same encoder is used to encode each channel separately. Often, there is strong correlation between different channels of the same audio system. Moreover, humans exhibit different sensitivities to the coding errors associated with different channels. Coding efficiency may thus be achieved if the channels are jointly coded. For example, when coding color images of a video frame, a color transformation is used to convert RGB images to YUV components. This allows bitrate reduction by coding the U and V components coarsely, i.e., using fewer bits, because humans can tolerate larger errors associated with coding of U and V components.

[0006] In the MPEG-4 audio standard, multiple audio channels may be encoded as channel pairs. For each channel pair, the left and right channels may be encoded independently, known as the LR mode of encoding. Alternatively, the left and right channels may be encoded using either mid/side coding, known as the MS mode of encoding, or using the intensity/stereo encoding, known as the IS mode of encoding. These three encoding modes may be changed for each scale-factor band. Mode selection is typically selected via a multitude of bits in the coding bitstream. By selecting different modes, coding efficiency may be improved.

[0007] Assume x_(l)[i] and x_(r)[i] respectively represent the i-th sample of left and right signals of a pair of channels. For the MS mode, a 2×2 linear transformation $\frac{1}{2}\begin{bmatrix} 1 & 1 \\ 1 & {- 1} \end{bmatrix}$

[0008] is used to de-correlate x_(l)[i] and x_(r)[i] to form the mid and side signals as follows: $\begin{matrix} {{x_{m}\lbrack i\rbrack} = {\frac{1}{2}\left( {{x_{l}\lbrack i\rbrack} + {x_{r}\lbrack i\rbrack}} \right)}} & (1) \\ {{x_{s}\lbrack i\rbrack} = {\frac{1}{2}\left( {{x_{l}\lbrack i\rbrack} - {x_{r}\lbrack i\rbrack}} \right)}} & (2) \end{matrix}$

[0009] The mid signal is the average of the left and right signals x_(l) and x_(r), and the side signal is the difference between these two signals. By performing the above transformation, a better compression is achieved if there is correlation between left signal x_(l) and right signal x_(r). If the left and right signals x_(l) and x_(r) are the same, the side signal is very small (or zero) and thus requires a small number bits to encode. Furthermore, the MS coding has been shown to improve auditory perception due to its control of the noise. If there is small correlation between left and right signals x_(l) and x_(r), the quantization errors may increase as a result of the above transformation, thereby degrading the coding efficiency of the MS mode. Moreover, additional overhead bits may be required to select between LR and MS modes.

[0010] The IS mode uses the relationship between human perception of high-frequency sound components and their energy-time envelopes. Thus, in the IS mode, often only one components is transmitted, from which energy time-envelops of the other components are reconstructed with a transmitted scale factor. In a two-channel system, often only the left channel is transmitted and the right channel is reconstructed at the decoder as shown below:

x _(r) [i]=sign×is_scale×x _(l) [i],  (3)

[0011] where the sign bit determines the sign of x_(r)[i] with respective to x_(l)[i] and the scale factor is_scale is obtained using the following equation: $\begin{matrix} {{is\_ scale} = 2^{{- \frac{1}{4}}\quad {is\_ position}}} & (4) \end{matrix}$

[0012] The sign and is_position are transmitted in the bitstream. The above is_position controls the scale factor is_scale. To transmit the energy envelop of the left channel, parameter is_scale is defined as:

is_scale=(E _(r) /E _(l))^(1/2)

[0013] Therefore: $\quad {{{is\_ position} = {Q\left( {2\quad \log_{2}\frac{E_{l}}{E_{r}}} \right)}},}$

[0014] where Q is a quantization operator quantizing $2\quad \log_{2}{\frac{E_{l}}{E_{r}}.}$

[0015] If left and right signals are linearly dependent or approximately linearly dependent, i.e., α₁x₁[1]+α_(r)x_(r)[i]≈0, the right signal can be reconstructed completely without or with small error. Since only one signal is sent and the scale factor requires small number of bits to transmit, significant coding gain can be achieved. However, if there is no correlation between left and right signals, the use of IS mode can introduce great perception distortion when hearing both reconstructed signals.

[0016] Since the coding efficiency associated with LR, MS or IS modes depends on the relationship between frames of the left and right channels, adaptively selecting which mode to be used may improve overall performance. One prior art technique is to encode the left and right channel frames using each of these three modes and select the mode which requires the fewest number of bits or the least perceptual distortion. However, because this technique requires that each audio frame be encoded three times, it is computationally inefficient.

BRIEF SUMMARY OF THE INVENTION

[0017] In accordance with one embodiment of the present invention, to select the encoding mode of an audio signal in a multi-channel system, a level of energy of the audio signal associated with each of the channels is first determined. These energy levels are subsequently used to compute a first value. Next, a degree of correlation between the audio signals associated with each channel is determined. The correlation is subsequently used to compute a second value. If the first value is smaller than the second value, the audio signal is encoded using a first encoding mode.

[0018] Next, a third value defined by the energy levels, and a fourth value defined by the degree of correlation are computed. If the first value is greater than the second value, and the third value is smaller than the fourth value, then the audio signal is encoded using a second encoding mode. If the first value is greater than the second value, and the third value is greater than the fourth value, then the audio signal is encoded using a third encoding mode.

[0019] In some embodiments, the system includes two channels and the encoding modes from which one is selected are IS, MS and LR. In these embodiments, the first value is defined by (τ E_(l) E_(r)) where τ is a programmable parameter defined by a user, and where energies E_(l) and E_(r) associated with the left and right channels are defined by: $\begin{matrix} {E_{l} = {\sum\limits_{i \in {band}}{x_{l}\lbrack i\rbrack}^{2}}} \\ {E_{r} = {\sum\limits_{i \in {band}}{x_{r}\lbrack i\rbrack}^{2}}} \end{matrix}$

[0020] where x_(l)[i] and x_(r)[i] respectively represent the i-th sample of the signals of the left and right channels, and wherein said second value is defined by the square of the cross-correlation of the signals of the left and right defined by: $C = {\sum\limits_{i \in {band}}{{x_{l}\lbrack i\rbrack}{x_{r}\lbrack i\rbrack}}}$

[0021] and where the IS mode of encoding is selected if C² is greater than (τ E_(l) E_(r)).

[0022] In these embodiments, the third value is defined by |E_(l)−E_(r)|, the fourth value is defined by 2|C|, the MS mode of encoding is selected if 2|C| is greater than |E_(l)−E_(r)|, and the LR mode of encoding is selected if 2|C| is smaller than |E_(l)−E_(r)|.

[0023] In some embodiments, in the IS mode of encoding, the left and right channel signals x_(l1) and x_(r1) are defined as following: $\begin{matrix} {{x_{l1}\lbrack i\rbrack} = \left\{ \begin{matrix} {a\left( {{x_{l}\lbrack i\rbrack} + {x_{r}\lbrack i\rbrack}} \right)} & {if} & {C > 0} \\ {a\left( {{x_{l}\lbrack i\rbrack} - {x_{r}\lbrack i\rbrack}} \right)} & {otherwise} & \quad \end{matrix} \right.} \\ {{x_{r1}\lbrack i\rbrack} = {b\quad {x_{l1}\lbrack i\rbrack}}} \end{matrix}$

[0024] Parameters a and b and is_position are defined as: $\begin{matrix} {{a = {\frac{1}{\sqrt{E_{l} + E_{r} + {2{C}}}} \times \sqrt{E_{l}}}}{b = {{2^{{- \frac{1}{4}}\quad {is\_ position}}{is\_ position}} = {Q\left( {2\quad \log_{2}\frac{E_{l}}{E_{r}}} \right)}}}} & \quad \end{matrix}$

[0025] where Q is a quantization operator.

[0026] In other embodiments, in the IS mode of encoding, the left and right channel signals x_(l1) and x_(r1) are defined as following: $\begin{matrix} {{x_{l1}\lbrack i\rbrack} = \left\{ \begin{matrix} {a\left( {{x_{l}\lbrack i\rbrack} + {x_{r}\lbrack i\rbrack}} \right)} & {if} & {C > 0} \\ {a\left( {{x_{l}\lbrack i\rbrack} - {x_{r}\lbrack i\rbrack}} \right)} & {otherwise} & \quad \end{matrix} \right.} \\ {{x_{r1}\lbrack i\rbrack} = {b\quad {x_{l1}\lbrack i\rbrack}}} \end{matrix}$

[0027] Parameters a and b and is_position are defined as: $\begin{matrix} {a = {\frac{1}{\sqrt{E_{l} + E_{r} + {2{C}}}} \times \left\{ \begin{matrix} {\sqrt{E_{r}}2^{\frac{1}{4}{is\_ position}}} & {{{if}\quad E_{r}} > E_{l}} \\ \sqrt{E_{l}} & {otherwise} \end{matrix} \right.}} \\ {b = 2^{{- \frac{1}{4}}{is\_ position}}} \\ {{is\_ position} = {Q\left( {2\log_{2}\frac{E_{l}}{E_{r}}} \right)}} \end{matrix}$

[0028] Some embodiments of the present invention are adapted to select between MS encoding and LR encoding of an audio signal. To encode an audio signal in these embodiments, in accordance with a first method four energy levels E_(l2), E_(r2), E_(ml) and E_(s1) defined as following are computed: $\begin{matrix} {E_{l2} = {\sum\limits_{i \in {band}}^{\quad}\quad {{x_{l}\lbrack i\rbrack}}}} \\ {E_{r2} = {\sum\limits_{i \in {band}}^{\quad}\quad {{x_{r}\lbrack i\rbrack}}}} \\ {E_{m1} = {\sum\limits_{i \in {band}}^{\quad}\quad {{{x_{r}\lbrack i\rbrack} + {x_{r}\lbrack i\rbrack}}}}} \\ {E_{s1} = {\sum\limits_{i \in {band}}^{\quad}\quad {{{x_{r}\lbrack i\rbrack} - {x_{r}\lbrack i\rbrack}}}}} \end{matrix}$

[0029] where x_(l)[i] and x_(r)[i] respectively are the i-th samples of the audio signal corresponding to the left and right channels. If (E_(l2)+E_(r2)) is greater than $\frac{1}{\sqrt{2}}\left( {E_{m1} + E_{s1}} \right)$

[0030] the MS mode is selected, otherwise the LR mode is selected.

[0031] To further reduce the number of computations, energy levels F₁ and F₂ defined as following are computed:

F ₁=(E _(l2) +E _(r2))

F ₂=(E _(m1) +E _(s1))

[0032] Accordingly, the MS mode is selected if 16×(F₁×F₂)+F₁+4×F₂ is greater than zero; otherwise the LR mode 16×(F₁−F₂)+F₁+4×F₂ is selected.

BRIEF DESCRIPTION OF THE DRAWINGS

[0033]FIG. 1 is a flow-chart of the steps performed in selecting one of IS, MS and LR modes for encoding of audio signals, in accordance with one embodiment of the present invention.

[0034]FIG. 2 is a flow-chart of the steps performed in selecting one of IS, MS and LR modes for encoding of audio signals, in accordance with another embodiment of the present invention.

[0035]FIG. 3 is a flow-chart of steps involved in selecting one of MS and LR modes, in accordance with one embodiment of the present invention.

[0036]FIG. 4 is a flow-chart of steps involved in selecting one of MS and LR modes, in accordance with another embodiment of the present invention.

DETAILED DESCRIPTION OF THE INVENTION

[0037] In accordance with one embodiment of the present invention, the degree of cross-correlation between corresponding audio frames of left and right channels is used, in part, to decide whether to encoded these frames in accordance with IS mode, as explained further below. Assume E_(l) represents the energy of the audio frame to be encoded by the left channel (hereinafter alternatively referred to as the left signal) and E_(r) represents the energy of the audio frame to be encoded by the right channel (hereinafter alternatively referred to as the right signal), accordingly: $\begin{matrix} {E_{l} = {\sum\limits_{i \in {band}}^{\quad}\quad {x_{l}\lbrack i\rbrack}^{2}}} & (5) \\ {E_{r} = {\sum\limits_{i \in {band}}^{\quad}\quad {x_{r}\lbrack i\rbrack}^{2}}} & (6) \end{matrix}$

[0038] where x_(l)[i] and x_(r)[i] respectively represent the i-th sample of the left and right signals.

[0039] The cross-correlation C between these two signals is defined as: $\begin{matrix} {C = {\sum\limits_{i \in {band}}^{\quad}\quad {{x_{l}\lbrack i\rbrack}{x_{r}\lbrack i\rbrack}}}} & (7) \end{matrix}$

[0040] which when normalized is as following: $\begin{matrix} {\rho = \frac{C}{\sqrt{E_{l}E_{r}}}} & (8) \end{matrix}$

[0041] In accordance with the first aspect of the present, mode IS is selected if ρ²>τ, where τ is a decision threshold defined by the user. Combining equations (7) and (8), it is seen that the IS mode is selected if:

C ² >τ E _(l) E _(r)  (9)

[0042] In some embodiments, τ is selected to have value between 0.9 and 1.

[0043] As seen from expression (9), if C² is greater than (τ E_(l) E_(r)), the IS mode is selected. If, however, C² is less than (τ E_(l) E_(r)), one of LR and MS mode is selected, as described further below. Assume that G_(LR) and G_(MS) represent the coding gains achieved from using the LR and MS modes, respectively:

G _(LR)=(E _(l) +E _(r))/(E _(l) E _(r))^(1/2)  (10)

G _(MS)=(E _(m) +E _(s))/(E _(m) E _(s))^(1/2)  (11)

[0044] where E_(m) and E_(s) are the energies of the MS signals x_(m) and x_(s) respectively. Signals x_(m) and x_(s) are obtained using equations (1) and (2) that are repeated below: $\begin{matrix} {{x_{m}\lbrack i\rbrack} = {\frac{1}{2}\left( {{x_{l}\lbrack i\rbrack} + {x_{r}\lbrack i\rbrack}} \right)}} & (1) \\ {{x_{s}\lbrack i\rbrack} = {\frac{1}{2}\left( {{x_{l}\lbrack i\rbrack} - {x_{r}\lbrack i\rbrack}} \right)}} & (2) \end{matrix}$

[0045] In accordance with the present invention, mode MS is selected signals if G_(MS) is greater than G_(LR). Using equations (10 and (2), energies E_(m) and E_(s) are as shown in the following: $\begin{matrix} {E_{m} = {{\frac{1}{4}{\sum\limits_{i \in {band}}^{\quad}\quad \left( {{x_{l}\lbrack i\rbrack} + {x_{r}\lbrack i\rbrack}} \right)^{2}}} = {\frac{1}{4}\left( {E_{l} + E_{r} + {2C}} \right)}}} & (12) \\ {E_{s} = {{\frac{1}{4}{\sum\limits_{i \in {band}}^{\quad}\quad \left( {{x_{l}\lbrack i\rbrack} - {x_{r}\lbrack i\rbrack}} \right)^{2}}} = {\frac{1}{4}\left( {E_{l} + E_{r} - {2C}} \right)}}} & (13) \end{matrix}$

[0046] By substituting equations (10 and (13) into equation (11) it is seen that:

G _(MS)=2(E _(l) +E _(r))/((E _(l) +E _(r))²−4C ²)^(1/2)  (14)

[0047] Thus, from equations (14) and (10), it is seen that G_(MS) is greater than G_(LR) if the following condition holds:

2|C|>|E _(l) −E _(r)  (15)

[0048] Therefore, if inequality (15) is true, in accordance with the present invention, mode MS is selected, otherwise mode LR is selected.

[0049] As is understood by those skilled in the art, the IS mode is more adapted for high frequency bands. Because the MS mode is obtained by a linear transformation, it may be selected for all frequency bands.

[0050] Generation of IS Signals

[0051] In accordance with another aspect of the present invention, right and left signals for use in the IS mode, are computed in accordance with the following: $\begin{matrix} {{x_{l1}\lbrack i\rbrack} = \left\{ \begin{matrix} {a\left( {{x_{l}\lbrack i\rbrack} + {x_{r}\lbrack i\rbrack}} \right)} & {if} & {C > 0} \\ {a\left( {{x_{l}\lbrack i\rbrack} - {x_{r}\lbrack i\rbrack}} \right)} & {otherwise} & \quad \end{matrix} \right.} & (16) \end{matrix}$

x _(r1) [i]=bx _(l1) [i]  (17)

[0052] Parameters a and b are described further below. As seen from equations (16) and (17), the right and left signals have different signs if C<0. Assume that E_(l1) and E_(r1) represent the energy of x_(l1)[i] and x_(r1)[i] respectively. From equations (16) and (17) it is seen that:

E _(l1) =a ²(E _(l) +E _(r)+2|C|)  (18)

E _(r1) =b ² E _(l1)  (19)

[0053] To determine a and b, the energy E_(l1) of the left signal x_(l1) is set to equal to the energy E_(l) of signal x_(l), shown in equation (5). Similarly, the energy E_(r1) of the right signal x_(r1) is set to equal to the energy E_(r) of signal x_(r), shown in equation (6). Accordingly, from equations (18)-(19) and ((5)-(6), it is seen that: $\begin{matrix} {a = {\frac{1}{\sqrt{E_{l} + E_{r} + {2{C}}}} \times \sqrt{E_{l}}}} & (20) \end{matrix}$

[0054] At the decoder, the right signal is constructed from the left signal using equation (3) that is shown again below:

x _(r) [i]=sign×is_scale×x _(l) [i],  (3)

[0055] Therefore: $b = 2^{{- \frac{1}{4}}\quad {is\_ position}}$

[0056] Using equations (21) and (4), it is seen that $\begin{matrix} {{is\_ position} = {Q\left( {2\quad \log_{2}\frac{E_{l}}{E_{r}}} \right)}} & (22) \end{matrix}$

[0057] where Q( ) represents a quantization operation. Because of the quantization operation, the reconstructed right signal at the decoder is often not exactly equal to that obtained using equation (17).

[0058] In accordance with one aspect of the present invention, scaling factor a is selected as shown below in equation (23) so as to further reduce the total energy difference between original and new left and right signals, i.e. the quantity of |E_(l1)+E_(r1)−E_(l)−E_(r)|: $\begin{matrix} {a = {\frac{1}{\sqrt{E_{l} + E_{r} + {2{C}}}} \times \left\{ \begin{matrix} {\sqrt{E_{r}}2^{\frac{1}{4}\quad {is\_ position}}} & {{{if}\quad E_{r}} > E_{l}} \\ \sqrt{E_{l}} & {otherwise} \end{matrix} \right.}} & (23) \end{matrix}$

[0059] If there is no quantization error in computing the is_position as a result of the quantization operation, then: $\sqrt{E_{l}} = {\sqrt{E_{r}}{2^{\frac{1}{4}\quad {is\_ position}}.}}$

[0060]FIG. 1 is a flow-chart 100 showing the steps involved in selecting one of IS, MS and LR modes, in accordance with the present invention. In step 102, left and right signals x_(l) and x_(r) are received from which energies E_(l), E_(r) and cross-correlation C are computed, in accordance with equations (5)-(7) described above. Next, in step 104, C² and τ E_(l) E_(r) are computed. As seen from equation (9), If C²is greater than τ E_(l) E_(r), then the IS mode is selected in step 106. Next, in step 108 and using equation (22) parameter is_position is computed. Next, in step 110, the left signal x_(l) is encoded.

[0061] If in step 104, C² is less than τ E_(l) E_(r), then the IS mode is not selected and the process moves to step 112, where 2|C| and |E_(l)−E_(r)| are computed. If 2|C| is greater than |E_(l)−E_(r)|, see inequality (15), then the MS mode is selected in step 114. Next, in step 116, x_(m) and x_(s) are encoded using equations (1) and (20 shown above. If in step 112, 2|C| is determined to be less than |E_(l)−E_(r)|, then the LR mode is selected in step 118. Next, in step 120, x_(r) and x_(l) are encoded.

[0062]FIG. 2 is a flow-chart 200, showing the steps involved in selecting one of IS, MS and LR modes, in accordance with the present invention. Except as for step 110, flow-chart 200 is similar to flow-chart 100 and is thus not described in detail. In step 130 of flow-chart 200, after the IS mode is selected in step 106, and parameter is_position is computed in step 108, left signal x_(l1) of the present invention and defined in equation (16), is computed using either equation (2) or equation (23).

[0063] Decision for MS and LR Modes

[0064] In some embodiments of the present invention, a decision is made to select between only the MS and LR modes. To further reduce the computations for these embodiments, by combining equations (12) and (13) it is shown that: $\begin{matrix} {{{\sum\limits_{i \in {band}}\left( {{x_{l}\lbrack i\rbrack} + {x_{r}\lbrack i\rbrack}} \right)^{2}} + {\sum\limits_{i \in {band}}\left( {{x_{l}\lbrack i\rbrack} - {x_{r}\lbrack i\rbrack}} \right)^{2}}} = {2\left( {E_{l} + E_{r}} \right)}} & (24) \end{matrix}$

[0065] Accordingly, in these embodiments, the MS mode is selected if the following inequality is true: $\begin{matrix} {\left( {E_{l2} + E_{r2}} \right) > {\frac{1}{\sqrt{2}}\left( {E_{m1} + E_{s1}} \right)}} & (25) \end{matrix}$

[0066] where energies E_(1l) and E_(l2) are the energy of original signals calculated using the absolute value operators, as shown below: $\begin{matrix} {E_{l2} = {\sum\limits_{i \in {band}}{{x_{l}\lbrack i\rbrack}}}} & (26) \\ {E_{r2} = {\sum\limits_{i \in {band}}{{x_{r}\lbrack i\rbrack}}}} & (27) \end{matrix}$

[0067] In accordance with the present invention, energies E_(m1) and E_(s1) are defined as following: $\begin{matrix} {E_{m1} = {\sum\limits_{i \in {band}}{{{x_{l}\lbrack i\rbrack} + {x_{r}\lbrack i\rbrack}}}}} & (28) \\ {E_{s1} = {\sum\limits_{i \in {band}}{{{x_{r}\lbrack i\rbrack} - {x_{r}\lbrack i\rbrack}}}}} & (29) \end{matrix}$

[0068]FIG. 3 is a flow-chart 300, showing the steps involved in selecting one of MS and LR modes, in accordance with the present invention, when only these two modes are available. In step 302, energies E_(l2), E_(r2), E_(m1) and E_(s1) are computed, in accordance with equations (26)-(29). Next, in step 304, it is determined whether inequality (25) is true or false. If inequality (25) is true, the MS mode is selected in step 306. Next, in step 308, mid and sid signals x_(m) and x_(s) signals are computed, in accordance with equations (1) and (2). If inequality (35) is false, the LR mode is selected in step 310. Next, in step 312, left and right signals x_(l) and x_(r) signals are computed.

[0069] To further reduce the computation, parameters F₁ and F₂ are defined as following:

F ₁=(E _(l2) +E _(r2))  (30)

F ₂=(E _(m1) +E _(s1)).  (31)

[0070] and {square root}{square root over (2)} is approximated as by 17/12 or 1.4167. Accordingly, inequality (25) used for selecting either the MS or the LR mode may be simplifies as:

16×(F ₁ −F ₂)+F ₁+4×F ₂>0  (32)

[0071] Since the multiplications by 16 and 4 my be implemented in digital logic by shifting operation, determination of whether to select MS or the LR mode is simplified.

[0072]FIG. 4 is a flow-chart 400, showing the steps involved in selecting one of the MS and LR modes, in accordance with the present invention, when only these two modes are available. In step 402, energy related parameters F₁ and F₂ are computed, in accordance with equations (26)-(3 1). Next, in step 404, it is determined whether inequality (32) is true or false. If inequality (35) is true, the MS mode is selected in step 406. Next, in step 408, mid and sid signals x_(m) and x_(s) signals are computed, in accordance with equations (1) and (2). If inequality (35) is false, the LR mode is selected in step 410. Next, in step 412, left and right signals x_(l) and x_(r) signals are computed.

[0073] It is understood that the above embodiments of the present invention may be performed entirely by software modules executed by a central processing unit. The above embodiments may also be performed by a combination of software and hardware modules. Alternatively, other embodiments may be performed entirely by dedicated hardware modules.

[0074] The above embodiments of the present invention are illustrative and not limitative. Various alternatives and equivalents are possible. Other additions, subtractions, deletions, and other modifications and changes to the present invention may be made thereto without departing from the scope of the present invention and is set forth in the appended claims. 

What is claimed is:
 1. A method for selecting an encoding mode of an audio signal in a multi-channel system, the method comprising: determining energy level of audio signal associated with each of the channels; computing a first value defined by said energy levels; determining degree of correlation between the audio signal associated with each of the channels; computing a second value defined by said degree of correlation; and selecting a first mode of encoding if the first value is smaller than the second value.
 2. The method of claim 1 further comprising: computing a third value defined by said energies; computing a fourth value defined by said degree of correlation; selecting a second mode of encoding if the first value is greater than the second value, and the third value is smaller than the fourth value; and selecting a third mode of encoding if the first value is greater than the second value, and the third value is greater than the fourth value.
 3. The method of claim 2 wherein said multi-channel system includes two channels, wherein said first value is defined by (τ E_(l) E_(r)) where τ is a programmable parameter and wherein energies E_(l) and E_(r) associated with the left and right channels are defined by: $\begin{matrix} {E_{l} = {\sum\limits_{i \in {band}}{x_{l}\lbrack i\rbrack}^{2}}} \\ {E_{r} = {\sum\limits_{i \in {band}}{x_{r}\lbrack i\rbrack}^{2}}} \end{matrix}$

where x_(l)[i] and x_(r)[i] respectively represent the i-th sample of the signals of the left and right channels, and wherein said second value is defined by the square of the cross-correlation of the signals of the left and right defined by: $C = {\sum\limits_{i \in {band}}{{x_{l}\lbrack i\rbrack}{x_{r}\lbrack i\rbrack}}}$

and wherein the IS mode of encoding is selected if C² is greater than (τ E_(l) E_(r)).
 4. The method of claim 3 wherein said third value is defined by |E_(l)−E_(r)| and wherein said fourth value is defined by 2|C|, wherein an MS mode of encoding is selected if 2|C| is greater than E_(l)−E_(r)|, and wherein an LR mode of encoding is selected if 2|C| is smaller than |E_(l)−E_(r)|.
 5. The method of claim 4 wherein the left and right channel signals x_(l1) and x_(r1) are defined as following if the IS mode is selected: ${x_{l\quad 1}\lbrack i\rbrack} = \left\{ {{\begin{matrix} {a\left( {{x_{l}(i)} + {x_{r}\lbrack i\rbrack}} \right)} & {if} & {C > 0} \\ {a\left( {{x_{l}\lbrack i\rbrack} - {x_{r}\lbrack i\rbrack}} \right)} & {otherwise} & \quad \end{matrix}{x_{r\quad l}\lbrack i\rbrack}} = {b\quad {x_{l\quad 1}\lbrack i\rbrack}}} \right.$

wherein said parameters a and b are defined as: $\begin{matrix} {a = {\frac{1}{\sqrt{E_{l} + E_{r} + {2{C}}}} \times \sqrt{E_{l}}}} \\ {b = 2^{{- \frac{1}{4}}{is\_ position}}} \end{matrix}$

where parameter is_position is defined as: ${is\_ position} = {Q\left( {2\log_{2}\frac{E_{l}}{E_{r}}} \right)}$

and wherein Q is a quantization operator.
 6. The method of claim 4 wherein the left and right channel signals x_(l1) and x_(r1) are defined as following if the IS mode is selected: ${x_{l\quad 1}\lbrack i\rbrack} = \left\{ {{\begin{matrix} {a\left( {{x_{l}(i)} + {x_{r}\lbrack i\rbrack}} \right)} & {if} & {C > 0} \\ {a\left( {{x_{l}\lbrack i\rbrack} - {x_{r}\lbrack i\rbrack}} \right)} & {otherwise} & \quad \end{matrix}{x_{r\quad l}\lbrack i\rbrack}} = {b\quad {x_{l\quad 1}\lbrack i\rbrack}}} \right.$

wherein said parameters a and b are defined as: $\begin{matrix} {a = {\frac{1}{\sqrt{E_{l} + E_{r} + {2{C}}}} \times \left\{ \begin{matrix} {\sqrt{E_{r}}2^{\frac{1}{4}{is\_ position}}} & {{{if}\quad E_{r}} > E_{l}} \\ \sqrt{E_{l}} & {otherwise} \end{matrix} \right.}} \\ {b = 2^{{- \frac{1}{4}}{is\_ position}}} \end{matrix}$

where parameter is_position is defined as: ${is\_ position} = {Q\left( {2\log_{2}\frac{E_{l}}{E_{r}}} \right)}$

and wherein Q is a quantization operator.
 7. A method for selecting between MS encoding and LR encoding of an audio signal in a system having a left channel and a right channel, the method comprising: computing four energy levels E_(l2), E_(l2), E_(m1) and E_(s1) defined as following: $\begin{matrix} {E_{l\quad 2} = {\sum\limits_{i \in {band}}{{x_{i}\lbrack i\rbrack}}}} \\ {E_{r\quad 2} = {\sum\limits_{i \in {band}}{{x_{r}\lbrack i\rbrack}}}} \\ {E_{m\quad 1} = {\sum\limits_{i \in {band}}{{{x_{l}\lbrack i\rbrack} + {x_{r}\lbrack i\rbrack}}}}} \\ {E_{s\quad 1} = {\sum\limits_{i \in {band}}{{{x_{r}\lbrack i\rbrack} - {x_{r}\lbrack i\rbrack}}}}} \end{matrix}$

where x_(l)[i] and x_(r)[i] respectively are the i-th samples of the audio signal corresponding to the left and right channels; selecting the MS mode if (E_(l2)+E_(r2)) is greater than ${\frac{1}{\sqrt{2}}\left( {E_{m\quad 1} + E_{s\quad 1}} \right)};$

selecting the LR mode if (E_(l2)+E_(l2)) is less than $\frac{1}{\sqrt{2}}{\left( {E_{m\quad 1} + E_{s\quad 1}} \right).}$


8. A method for selecting between MS encoding and LR encoding of an audio signal in a system having a left channel and a right channel, the method comprising: computing four energy levels E_(l2), E_(r2), E_(m1) and E_(s1) defined as following: $\begin{matrix} {E_{l\quad 2} = {\sum\limits_{i \in {band}}{{x_{i}\lbrack i\rbrack}}}} \\ {E_{r\quad 2} = {\sum\limits_{i \in {band}}{{x_{r}\lbrack i\rbrack}}}} \\ {E_{m\quad 1} = {\sum\limits_{i \in {band}}{{{x_{l}\lbrack i\rbrack} + {x_{r}\lbrack i\rbrack}}}}} \\ {E_{s\quad 1} = {\sum\limits_{i \in {band}}{{{x_{r}\lbrack i\rbrack} - {x_{r}\lbrack i\rbrack}}}}} \end{matrix}$

where x_(l)[i] and x_(r)[i] respectively are the i-th samples of the audio signal corresponding to the left and right channels; computing energy levels F₁ and F₂ defined as following: F ₁=(E _(l2) +E _(r2)) F ₂=(E _(m1) +E _(s1)) selecting the MS mode if 16×(F₁−F₂)+F₁+4×F₂ is greater than zero; and selecting the LR mode if 16×(F₁−F₂)+F₁+4×F₂ is less than zero.
 9. An apparatus configured to select an encoding mode of an audio signal in a multi-channel system, the apparatus comprising: a module configured to determine energy level of audio signal associated with each of the channels; a module configured to compute a first value defined by said energy levels; a module configured to determine degree of correlation between the audio signal associated with each of the channels; a module configured to compute a second value defined by said degree of correlation; and a module configured to select a first mode of encoding if the first value is smaller than the second value.
 10. The apparatus of claim 9 further comprising: a module configured to compute a third value defined by said energies; a module configured to compute a fourth value defined by said degree of correlation; a module configured to select a second mode of encoding if the first value is greater than the second value, and the third value is smaller than the fourth value; and a module configured to select a third mode of encoding if the first value is greater than the second value, and the third value is greater than the fourth value.
 11. The apparatus of claim 10 wherein said multi-channel system includes two channels, wherein said first value is defined by (τ E_(l) E_(r)) where τ is a programmable parameter and wherein energies E_(l) and E_(r) associated with the left and right channels are defined by: $E_{l} = {\sum\limits_{i \in {band}}{x_{l}\lbrack i\rbrack}^{2}}$ $E_{r} = {\sum\limits_{i \in {band}}{x_{r}\lbrack i\rbrack}^{2}}$

where x_(l)[i] and x_(r)[i] respectively represent the i-th sample of the signals of the left and right channels, and wherein said second value is defined by the square of the cross-correlation of the signals of the left and right defined by: $C = {\sum\limits_{i \in {band}}{{x_{l}\lbrack i\rbrack}{x_{r}\lbrack i\rbrack}}}$

and wherein the IS mode of encoding is selected if C² is greater than (τ E_(l) E_(r)).
 12. The apparatus of claim 11 wherein said third value is defined by |E_(l)−E_(r)| and wherein said fourth value is defined by 2|C|, wherein an MS mode of encoding is selected if 2|C| is greater than E_(l)−E_(r)|, and wherein an LR mode of encoding is selected if 2|C| is smaller than |E_(l)−E_(r)|.
 13. The apparatus of claim 12 wherein the left and right channel signals x_(l1) and x_(r1) are defined as following if the IS mode is selected: ${x_{l1}\lbrack i\rbrack} = \left\{ {{\begin{matrix} {a\left( {{x_{l}\lbrack i\rbrack} + {x_{r}\lbrack i\rbrack}} \right)} & {{{if}\quad C} > 0} \\ {a\left( {{x_{l}\lbrack i\rbrack} - {x_{r}\lbrack i\rbrack}} \right)} & {otherwise} \end{matrix}{x_{r1}\lbrack i\rbrack}} = {{bx}_{l1}\lbrack i\rbrack}} \right.$

wherein said parameters a and b are defined as: $a = {\frac{1}{\sqrt{E_{l} + E_{r} + {2{C}}}} \times \sqrt{E_{l}}}$ $b = 2^{{- \frac{1}{4}}\quad {is\_ position}}$

where parameter is_position is defined as: ${is\_ position} = {Q\left( {2\log_{2}\frac{E_{l}}{E_{r}}} \right)}$

and wherein Q is a quantization operator.
 14. The apparatus of claim 12 wherein the left and right channel signals x_(l1) and x_(r1) are defined as following if the IS mode is selected: ${x_{l1}\lbrack i\rbrack} = \left\{ {{\begin{matrix} {a\left( {{x_{l}\lbrack i\rbrack} + {x_{r}\lbrack i\rbrack}} \right)} & {{{if}\quad C} > 0} \\ {a\left( {{x_{l}\lbrack i\rbrack} - {x_{r}\lbrack i\rbrack}} \right)} & {otherwise} \end{matrix}{x_{r1}\lbrack i\rbrack}} = {{bx}_{l1}\lbrack i\rbrack}} \right.$

wherein said parameters a and b are defined as: $a = {\frac{1}{\sqrt{E_{l} + E_{r} + {2{C}}}} \times \left\{ {{\begin{matrix} {\sqrt{E_{r}}2^{\frac{1}{4}{is\_ position}}} & {{{if}\quad E_{r}} > E_{l}} \\ \sqrt{E_{l}} & {otherwise} \end{matrix}b} = 2^{{- \frac{1}{4}}\quad {is\_ position}}} \right.}$

where parameter is_position is defined as: ${is\_ position} = {Q\left( {2\log_{2}\frac{E_{l}}{E_{r}}} \right)}$

and wherein Q is a quantization operator.
 15. An apparatus configured to select between MS encoding and LR encoding of an audio signal and having a left channel and a right channel, the apparatus comprising: a module configured to compute four energy levels E_(l2), E_(r2), E_(m1) and E_(s1) defined as following: $E_{l2} = {\sum\limits_{i \in {band}}{{x_{l}\lbrack i\rbrack}}}$ $E_{r2} = {\sum\limits_{i \in {band}}{{x_{r}\lbrack i\rbrack}}}$ $E_{m1} = {\sum\limits_{i \in {band}}{{{x_{l}\lbrack i\rbrack} + {x_{r}\lbrack i\rbrack}}}}$ $E_{s1} = {\sum\limits_{i \in {band}}{{{x_{r}\lbrack i\rbrack} - {x_{r}\lbrack i\rbrack}}}}$

where x_(l)[i] and x_(r)[i] respectively are the i-th samples of the audio signal corresponding to the left and right channels; a module configured to select the MS mode if (E_(l2)+E_(r2)) is greater than ${\frac{1}{\sqrt{2}}\left( {E_{m1} + E_{s1}} \right)};$

and a module configured to compute the LR mode if (E_(l2)+E_(r2)) is less than $\frac{1}{\sqrt{2}}{\left( {E_{m1} + E_{s1}} \right).}$


16. An apparatus configured to select between MS encoding and LR encoding of an audio signal and having a left channel and a right channel, the apparatus comprising: a module configured to compute four energy levels E_(l2), E_(r2), E_(m1) and E_(s1) defined as following: $E_{l2} = {\sum\limits_{i \in {band}}{{x_{l}\lbrack i\rbrack}}}$ $E_{r2} = {\sum\limits_{i \in {band}}{{x_{r}\lbrack i\rbrack}}}$ $E_{m1} = {\sum\limits_{i \in {band}}{{{x_{l}\lbrack i\rbrack} + {x_{r}\lbrack i\rbrack}}}}$ $E_{s1} = {\sum\limits_{i \in {band}}{{{x_{r}\lbrack i\rbrack} - {x_{r}\lbrack i\rbrack}}}}$

where x_(l)[i] and x_(r)[i] respectively are the i-th samples of the audio signal corresponding to the left and right channels; a module configured to compute energy levels F₁ and F₂ defined as following: F ₁=(E _(l2) +E _(r2)) F ₂=(E _(m1) +E _(s1)) a module configured to select the MS mode if 16×(F₁−F₂)+F₁+4×F₂ is greater than zero; and a module configured to select the LR mode if 16×(F₁−F₂)+F₁+4×F₂ is less than zero. 